<template>
  <div class="serviceLog">
      <!-- @subFn2="searchFn2" -->
      <serviceLogTop @subFn2="searchFn2"/>
      <serviceLogDown :searchList2="list2"/>
  </div>
</template>

<script>
import axios from 'axios'
axios.defaults.baseURL="http://localhost:8080/"
import serviceLogTop from '../../components/Serve/serviceLogTop.vue'
import serviceLogDown from '../../components/Serve/serviceLogDown.vue'
export default {
    data () {
        return {
            list2:[]
        }
    },
    components: {
        serviceLogTop,
        serviceLogDown,
    },
    created () {
      document.querySelector('body').setAttribute('style', 'background-color:#F2F7FB')
      this.queryList2()  
    },
    methods: {
        searchFn2(value,value1,value2,value3,value4,serviceName){
            // alert(value)
            axios({
                url:'serve/getServeList2',
                method:'GET',
                params:{
                serve_state:value,
                sign_organization: value1,
                sign_team:value2,
                serve_page:value3,
                staDate:value4[0],
                endDate:value4[1],
                user_name:serviceName,    
                }
            }).then((res) => {
                this.list2=res.data      //把值传到list里面
            })
        },
        queryList2() {
            axios({
                url: "serve/getServeList2",
                method: "GET",
            }).then((res) => {
                this.list2 = res.data; //把值传到list里面
                console.log(res.data);
            });
        },
    }
}
</script>

<style>
    .serviceLog{
        width: 1150px;
        height: 1030px;
        background: white;
        margin: 20px auto;
        box-sizing: border-box;
        padding: 10px;
    }
</style>